<template>
  <div class="chart-card">
    <div class="chart-header">
      <h2 class="chart-title">{{ title }}</h2>
      <div v-if="actions && actions.length" class="chart-actions">
        <button v-for="action in actions" :key="String(action)" class="chart-btn" :class="{active: action === activeAction}" @click="$emit('action', action)">
          {{ action }}
        </button>
      </div>
    </div>
    <div class="chart-wrapper">
      <slot></slot>
    </div>
  </div>
</template>
<script setup lang="ts">
const props = defineProps<{ title: string; actions?: string[]; activeAction?: string; chartType?: string; chartData?: any }>()
const emit = defineEmits(['action'])
</script>
<script lang="ts">
export default {}
</script>
<style scoped>
.chart-card {
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.chart-title {
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}
.chart-actions {
  display: flex;
  gap: 10px;
}
.chart-btn {
  padding: 6px 12px;
  border-radius: 20px;
  background: #e6f0ff;
  color: #0d6efd;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chart-btn.active {
  background: #0d6efd;
  color: #fff;
}
.chart-wrapper {
  height: 300px;
  position: relative;
}
</style> 